package top.jybill.service;

import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetailsService;
import top.jybill.domain.MyPageInfo;
import top.jybill.domain.MyUser;
import top.jybill.domain.Role;

import java.util.List;

public interface IUserService {

  /**
   * 登陆用户
   * @param user
   * @return
   */
  MyUser findUser(MyUser user);

  /**
   * 查询所有的用户通过分页组件
   * @param page
   * @return
   */
  MyPageInfo findUsersByPage(MyPageInfo page) throws Exception;

  /**
   * 添加用户
   * @param user
   */
  void addUser(MyUser user) throws Exception;

  /**
   * 根据uid删除用户及其关联的角色
   * @param uid
   */
  void delUser(String uid);

  void updateUser(MyUser user) throws Exception;

  MyUser findUserByuid(String uid);
}
